import Vue from 'vue';
import Vuex from 'vuex';

Vue.use(Vuex);

const store = new Vuex.Store({
	state: {
		isLogin: false,
		userInfo: {},
		place:{},
		markers:[],
		transportList:[],
	},
	mutations: {
		savePath(state,place){
			state.place = place;
		},
		showLoading() {
			uni.showLoading({
				title: '加载中...'
			});
		},
		hideLoading() {
			uni.hideLoading();
		},
		saveUserInfo(state,userInfo){
			state.userInfo = userInfo;
		},
		saveTransport(state,arr){
			state.transportList = arr;
		},
		saveMarkers(state,marker){
			state.markers = marker;
		}
	},
	actions: {

	}
})

export default store;
